<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<link href="<s:url value='/ui/scripts/themes/designer.css' />" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/ui/workflow/wfmc.util.loadlibrary-min.js"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.core.js' />"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.widget.js' />"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.mouse.js' />"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.draggable.js' />"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.selectable.js' />"></script>
<script type="text/javascript" src="<s:url value='/ui/scripts/jquery.ui.droppable.js' />"></script>
<script lang="javascript" type="text/javascript">
var dataObj, flow;
var fieldStatusArray = [{
    id: 1,
    name: '可写'
}, {
    id: 2,
    name: '只读'
}, {
    id: 3,
    name: '隐藏'
}];
// 页面初始化
$(function(){
    loadFlow();
    var workSpace = loadNewWfmc({
        toolsbar: true,
        statusbar: true
    });
    flow = workSpace.currentFlow;
    
    $('#partGrid').datagrid({
        singleSelect: false,
        fit: true,
        pagination: false,
        rownumbers: true
    });
    
    $('#partType').combobox({
        onSelect: function(record) {
            reloadPartTree(record.value);
        }
    });
    
    var processTypeSid = $('#processGrid').datagrid('getSelected').processTypeSid;
    var formBaseSid = $('#processGrid').datagrid('getSelected').formBaseSid;
    var dataActity=[];
	//发文
	if(formBaseSid=='1'){
		for(var i=0;i<option.documentDispatch.length;i++){
			var object = {
				cname:option.documentDispatchCname[i],
				value:option.documentDispatch[i]
			};
			dataActity.push(object);
		}
	}else if(formBaseSid=='2'){
		for(var i=0;i<option.documentReceive.length;i++){
			var object = {
				cname:option.documentReceiveCname[i],
				value:option.documentReceive[i]
			};
			dataActity.push(object);
		}
	}else{
		for(var i=0;i<option.otherId.length;i++){
			var object = {
				cname:option.otherCname[i],
				value:option.otherId[i]
			};
			dataActity.push(object);
		}
	}
    $('#activityType').combobox({
        valueField: 'value',
        textField: 'cname',
        data:dataActity
    });
    
    $('#formViewSid').combobox({
        valueField: 'sid',
        textField: 'cname',
        url: CTX + '/bpf/FormView!findFormViewByFormSid.action?entity.formSid=' + formBaseSid,
        onSelect: function(record) {
            $('#viewDescription').val(record.description);
           
        }
    });
    $.post(CTX + '/bpf/FormBase!findMasterAndSingleSlaveField.action', {
            'entity.sid': formBaseSid
    }, function(data) {
            if (data.success) {
                $('#fieldTable').children().remove();
                $.each(data.result, function() {
                	addFormField(this);
                });
            }
    });
};

function addFormField(result) {
    var id = result.formTableName + '_' + result.ename;
    var str = '<tr sid="' + result.sid + '" ename="' + result.ename + '" tableName="' + result.formTableName + '"><td>' + result.formTableCname + '-' + result.cname +
    '</td><td><select id="' +
    id +
    '" name="' +
    result.ename +
    '" class="easyui-combobox" /></td></tr>';
    $('#fieldTable').append(str);
    $('#' + id).combobox({
        data: fieldStatusArray,
        textField: 'name',
        valueField: 'id',
        value: 1
    });
};

// 加载流程方法
function loadFlow() {
    mask();
};

// 活动属性窗口确定按钮
function nodeWinSubmit() {
    if (!$('#nodeForm').form('validate')) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    // 封装活动基本属性对象
    var formData = getFormValues($('#nodeForm'));
    
    // 重置活动名称和基本属性
    dataObj.name = formData.alias;
    dataObj.attr = formData;
    // 重新加载活动label名称
    dataObj.view.label.updateName();
    
    $('#nodeWin').window('close');
};

// 活动属性窗口打开方法
function openNodeWin(node) {
    dataObj = node;
    $('#nodeWin').window('open').window('setTitle', '活动属性：' + node.name);
    $('#nodeForm').form('clear');
    if (node.attr) {
        $('#nodeForm').form('load', node.attr);
    } else {
        $('#nodeForm').form('load', {
            sid: node.id,
            name: node.name,
            alias: node.name,
            processDefinitionSid: $('#processGrid').datagrid('getSelected').sid,
            isTransient: true
        });
    }
};

// 事件窗口添加action方法
function addAction(data) {
    var id = getId();
    if ($('#' + id, '#actionPanel').length > 0) {
        id++;
    }
    var actionStr = '<form id="' + id + '">' +
    '<input name="isTransient" type="hidden" value="true" />' +
    '<input name="eventSid" type="hidden" value="' +
    $('input[name="sid"]', $('#eventForm')).val() +
    '" /><input name="processDefinitionSid" type="hidden" value="' +
    $('#processGrid').datagrid('getSelected').sid +
    '" /><input name="sid" type="hidden" value="' +
    getId() +
    '" /><table class="data-form-table"><tr>' +
    '<td class="form_td_label">名称：</td>' +
    '<td class="form_td_field">' +
    '<input name="name" class="easyui-validatebox" validType="length[1,50]" notnull="true" /></td>' +
    '<td class="form_td_label">类型：</td>' +
    '<td class="form_td_field">' +
    '<select id="cbx' +
    id +
    '" name="actionType" class="easyui-combobox" notnull="true">' +
    '<option value="class">class</option>' +
    '<option value="sql">sql</option>' +
    '<option value="beanshell">beanshell</option>' +
    '<option value="groovy">groovy</option></select></td>' +
    '<td><a href="#" onclick="delAction(' +
    id +
    ')">删除</a></td></tr>' +
    '<tr><td id="td' +
    id +
    '" class="form_td_label">类名：</td>' +
    '<td colspan="4" class="form_td_field">' +
    '<textarea name="scripts" class="easyui-validatebox" notnull="true" cols="70" /></td></tr></table></form>';
    
    $('#actionPanel').append(actionStr);
    
    $('#cbx' + id).combobox({
        onSelect: function(record) {
            if (record.value == 1) {
                $('#td' + id).html('类名：');
            } else {
                $('#td' + id).html('脚本：');
            }
        }
    })
    $.parser.parse($('#' + id));
    if (data) {
        $('#' + id).form('load', data);
    }
};

// 事件窗口删除action方法
function delAction(id) {
    $('#' + id).remove();
};

// 事件窗口提交方法
function eventWinSubmit() {
    // 封装事件基本属性对象
    var formData = getFormValues($('#eventForm'));
    var result = eventAction();
    if (!result.valid) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    formData.actionList = result.actionList;
    dataObj[formData.eventType] = formData;
    
    $('#eventWin').window('close');
};

// 拼装事件action对象
function eventAction() {
    var actionList = [], valid = true;
    $.each($('#actionPanel').children(), function() {
        actionList.push(getFormValues($(this)));
        valid = $(this).form('validate');
    });
    return {
        actionList: actionList,
        valid: valid
    };
};

// 事件窗口打开方法
function openEventWin(node, eventType) {
    dataObj = node;
    var title = eventType == 'activity-enter' ? '进入活动事件：' : eventType == 'activity-leave' ? '离开活动事件' : eventType == 'transition' ? '路由事件' : eventType == 'process-start' ? '流程开始事件' : eventType == 'process-end' ? '流程结束事件' : '';
    $('#eventWin').window('open').window('setTitle', title);
    $('#actionPanel').children().remove();
    if (node[eventType]) {
        $('#eventForm').form('load', node[eventType]);
        $.each(node[eventType].actionList, function() {
            addAction(this);
        });
    } else {
        $('#eventForm').form('load', {
            sid: getId(),
            eventType: eventType,
            activitySid: eventType.indexOf('activity') == 0 ? node.id : '',
            transitionSid: eventType == 'transition' ? node.id : '',
            processDefinitionSid: $('#processGrid').datagrid('getSelected').sid,
            isTransient: true
        });
    }
};

// 打开路由属性窗口方法
function openLineWin(line) {
    dataObj = line;
    $('#lineWin').window('open').window('setTitle', '路由属性');
    $('#lineForm').form('clear');
    if (line.attr) {
        $('#lineForm').form('load', line.attr);
    } else {
        $('#lineForm').form('load', {
            sid: line.id,
            fromSid: line.fromNodeId,
            toSid: line.toNodeId,
            processDefinitionSid: $('#processGrid').datagrid('getSelected').sid,
            isTransient: true
        });
    }
};

// 路由窗口确定按钮
function lineWinSubmit() {
    if (!$('#lineForm').form('validate')) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    // 封装路由基本属性对象
    var formData = getFormValues($('#lineForm'));
    
    // 重置路由基本属性
    dataObj.attr = formData;
    $('#lineWin').window('close');
};

// 活动操作对象窗口确定按钮
function partWinSubmit() {
    var rows = $('#partGrid').datagrid('getRows');
    if ($('#partType').combobox('getValue') == '0') {
        dataObj.partList = [{
            participationSid: '0',
            activitySid: dataObj.attr.sid,
            type: $('#partType').combobox('getValue'),
            participationCname: '全单位'
        }];
    }else if ($('#partType').combobox('getValue') == '5') {
        dataObj.partList = [{
            participationSid: '0',
            activitySid: dataObj.attr.sid,
            type: $('#partType').combobox('getValue'),
            participationCname: '全区'
        }];
    } else {
        dataObj.partList = rows;
    }
    $('#partWin').window('close');
};

// 活动操作对象窗口打开方法
function openPartWin(node) {
    dataObj = node;
    $('#partWin').window('open').window('setTitle', '活动操作对象：' + node.name);
    var partList = node.partList;
    if (partList && partList.length > 0) {
        $('#partType').combobox('select', partList[0].type);
        $.each(partList, function() {
            if (this.type != '0' && this.type != '5') {
                $('#partGrid').datagrid('appendRow', this);
            }
        });
    } else {
        reloadPartTree('0');
    }
};

// 加载操作对象待选树方法
function reloadPartTree(type) {
	$('#partType').combobox('setValue', type);
    // 清空已选列表数据
    $('#partGrid').datagrid('loadData', {
        total: 0,
        rows: []
    });
    if (type == '0') {// 全单位隐藏待选
        if ($("#targetTree").tree('getRoot') != null) {
            $("#targetTree").hide();
        }
    }else if (type == '5') {//全集团的时候隐藏
    	 if ($("#targetTree").tree('getRoot') != null) {
             $("#targetTree").hide();
         }
    } else if (type == '4') {// 选择活动，根据当前流程已绘制活动拼装待选活动列表
        $("#targetTree").show();
        var targetTreeData = [];
        $.each(flow.nodeList, function() {
            if (this.type == 'normal' && this.id != dataObj.id) {
                targetTreeData.push({
                    id: this.id,
                    text: this.attr.alias
                });
            }
        });
        $("#targetTree").tree({
            url: '',
            checkbox: true,
            cascadeCheck: false,
            onlyLeafCheck: type == '1' ? false : true,
            onDblClick: function(node) {
                addRecord(node, type);//双击时，自动将对应的内容加入到右边的列表
            }
        }).tree('loadData', targetTreeData);
    } else {
        $("#targetTree").show();
        var treeUrl = '';
        if (type == '1') {
            //部门树
            treeUrl = CTX + '/sys/Organization!sysOrganizationTree.action?entity.sid=0';
        } else if (type == '2') {
            //部门岗位树
            treeUrl = CTX + '/sys/Organization!sysOrganizationPostTree.action?entity.sid=0';
        } else if (type == '3') {
            //部门岗位人员树
            treeUrl = CTX + '/sys/Organization!sysGroupUserTree.action';
        } 
        //加载对应的人员
        $("#targetTree").tree({
            url: treeUrl,
            checkbox: true,
            cascadeCheck: false,
            onlyLeafCheck: type == '1' ? false : true,
            onBeforeLoad: function(row, param) {
                if (row) {
                	if(type=='3'){
                		treeUrl = CTX + '/sys/Organization!sysGroupUserTree.action?id='+ row.id;
                	}else{
                		return false;
                	}
                }
            },
            onDblClick: function(node) {
                if (type != '1' && node.state) {
                    return false;
                }
                addRecord(node, type);//双击时，自动将对应的内容加入到右边的列表
            }
        });
    }
};

// 添加活动操作对象方法
function addItem() {
    var nodeList = $("#targetTree").tree("getChecked");
    if (nodeList.length < 1) {
        return false;
    }
    $.each(nodeList, function() {
        addRecord(this, $('#partType').combobox('getValue'));
        $("#targetTree").tree("uncheck", this.target);
    });
};

// 活动操作对象待选列表加载数据
function addRecord(node, type) {
    var rows = $('#partGrid').datagrid('getRows');
    var addFlag = true;
    
    // 参照活动只能选一个活动
    if (type == '4' && rows.length > 0) {
        addFlag = false;
    }
    
    // 校验所选node是否已添加
    $.each(rows, function() {
        var nodeid = node.id;
        if (type == 2) {//岗位
            var prefix = nodeid.substring(0, 1);
            var suffix = nodeid.substring(1, nodeid.length);
            if ("p" == prefix) {
                if (this.participationSid == suffix) {
                    addFlag = false;
                    return false;
                }
            } else {
                addFlag = false;
                return false;
            }
        } else if (type == 3) {//人员
            var prefix = nodeid.substring(0, 1);
            var suffix = nodeid.substring(1, nodeid.length);
            if ("u" == prefix) {
                if (this.participationSid == suffix) {
                    addFlag = false;
                    return false;
                }
            } else {
                addFlag = false;
                return false;
            }
        } else {
            if (this.participationSid == node.id) {
                addFlag = false;
                return false;
            }
        }
    });
    if (addFlag) {
        var suffix = node.id;
        if (type == "2" || type == "3") {
            suffix = suffix.substring(1, suffix.length);
        }
        $('#partGrid').datagrid('appendRow', {
            activitySid: dataObj.attr.sid,
            //participationSid: node.id,
            participationSid: suffix,
            participationCname: node.text,
            type: type
        });
    }
};
// 删除已选活动操作对象
function removeItem() {
    var rows = $('#partGrid').datagrid('getSelections');
    $.each(rows, function() {
        var index = $('#partGrid').datagrid('getRowIndex', this);
        $('#partGrid').datagrid('deleteRow', index);
    });
};

// 全局变量添加全局变量方法
function addVariable(data) {
    var id = getId();
    if ($('#' + id, '#variPanel').length > 0) {
        id++;
    }
    var variStr = '<form id="' + id + '">' +
    '<input name="isTransient" type="hidden" value="true" />' +
    '<input name="processDefinitionSid" type="hidden" value="' +
    $('#processGrid').datagrid('getSelected').sid +
    '" /><input name="sid" type="hidden" value="' +
    getId() +
    '" /><table class="data-form-table"><tr>' +
    '<td class="form_td_label">名称：</td>' +
    '<td class="form_td_field">' +
    '<input name="name" class="easyui-validatebox" validType="length[1,50]" notnull="true" /></td>' +
    '<td class="form_td_label">中文名称：</td>' +
    '<td class="form_td_field">' +
    '<input name="mappedName" class="easyui-validatebox" validType="length[1,50]" notnull="true" /></td>' +
    '<td><a href="#" onclick="delAction(' +
    id +
    ')">删除</a></td></tr><tr>' +
    '<td class="form_td_label">数据类型：</td>' +
    '<td class="form_td_field">' +
    '<select name="dataType" class="easyui-combobox" notnull="true">' +
    '<option value="integer">integer</option>' +
    '<option value="decimal">decimal</option>' +
    '<option value="string">string</option>' +
    '<option value="boolean">boolean</option>' +
    '<option value="datetime">datetime</option>' +
    '<option value="object">object</option>' +
    '<td class="form_td_label">表达式类型：</td>' +
    '<td colspan="2" class="form_td_field">' +
    '<select name="expressionType" class="easyui-combobox" notnull="true">' +
    '<option value="sql">sql</option>' +
    '<option value="beanshell">beanshell</option>' +
    '<option value="groovy">groovy</option></select></td></tr>' +
    '<tr><td class="form_td_label">表达式：</td>' +
    '<td colspan="4" class="form_td_field">' +
    '<textarea name="expressions" class="easyui-validatebox" notnull="true" cols="70" /></td></tr></table></form>';
    $('#variPanel').append(variStr);
    $.parser.parse($('#' + id));
    if (data) {
        $('#' + id).form('load', data);
    }
};

// 打开全局变量窗口
function openVariWin() {
    $('#variWin').window('open');
    $('#variPanel').children().remove();
    $('#variPanel').text($('#table_names_hidden_div').text());
    if (flow.variableDefinitionList) {
        $.each(flow.variableDefinitionList, function() {
        	addVariable(this);
        });
    }
};

// 全局变量窗口提交方法
function variWinSubmit() {
    // 封装全局变量对象
    var variableDefinitionList = [], valid = true;
    $.each($('#variPanel').children(), function() {
        variableDefinitionList.push(getFormValues($(this)));
        valid = $(this).form('validate');
    });
    if (!valid) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    flow.variableDefinitionList = variableDefinitionList;
    $('#variWin').window('close');
};

// 条件表达式窗口添加条件表达式方法
function addCondition(data) {
    var id = getId();
    var actionStr = '<form id="' + id + '">' +
    '<input name="processDefinitionSid" type="hidden" value="' +
    $('#processGrid').datagrid('getSelected').sid +
    '" /><input name="sid" type="hidden" value="' +
    getId() +
    '" /><input name="transitionSid" type="hidden" value="' +
    dataObj.id +
    '" /><input name="processDefinitionSid" type="hidden" value="' +
    flow.id +
    '" /><table class="data-form-table"><tr>' +
    '<td class="form_td_label">类型：</td>' +
    '<td class="form_td_field">' +
    '<select id="cbx' +
    id +
    '" name="expressionType" class="easyui-combobox" notnull="true">' +
    '<option value="sql">sql</option>' +
    '<option value="beanshell">beanshell</option>' +
    '<option value="groovy">groovy</option></select></td>' +
    '<td><a href="#" onclick="delCondition(' +
    id +
    ')">删除</a></td></tr>' +
    '<tr><td id="td' +
    id +
    '" class="form_td_label">表达式：</td>' +
    '<td colspan="3" class="form_td_field">' +
    '<textarea name="expressions" class="easyui-validatebox" notnull="true" cols="70" /></td></tr></table></form>';
    
    $('#conditionPanel').append(actionStr);
    $.parser.parse($('#' + id));
    
    if (data) {
        $('#' + id).form('load', data);
    }
    
    $('#addConditionBtn').linkbutton('disable');
};

// 打开条件表达式窗口
function openConditionWin(line) {
    dataObj = line;
    $('#conditionWin').window('open');
    $('#addConditionBtn').linkbutton('enable');
    $('#conditionPanel').children().remove();
    if (line.conditionList) {
        $.each(line.conditionList, function() {
            addCondition(this);
        });
    }
};

// 条件表达式窗口提交方法
function conditionWinSubmit() {
    // 封装条件表达式对象
    var conditionList = [], valid = true;
    $.each($('#conditionPanel').children(), function() {
        conditionList.push(getFormValues($(this)));
        valid = $(this).form('validate');
    });
    if (!valid) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    dataObj.conditionList = conditionList;
    $('#conditionWin').window('close');
};

// 删除条件表达式
function delCondition(id) {
    $('#' + id).remove();
    $('#addConditionBtn').linkbutton('enable');
};

// 开打字段配置窗口
function openFormFieldWin(node) {
    dataObj = node;
    $('#formFieldWin').window('open');
	$('#formViewSid').combobox('setValue', '');
    $('#viewDescription').val('');
    $.each($('#fieldTable').children().children(), function() {
        $('select', $(this).children()).combobox('setValue', 1);
    });
	if (node.viewReference) {
		$('#formViewSid').combobox('select', node.viewReference.viewSid);
		$.each(node.viewReference.viewRefDefList, function() {
			$('#' + this.tableName + '_' + this.fieldEname).combobox('setValue', this.fieldStatus);
		});
	}
};

// 字段配置窗口提交
function formFieldWinSubmit() {
    if (!$('#viewForm').form('validate')) {
        $.messager.show({
            msg: UIE_TIP_VALIDATION
        });
        return false;
    }
    var viewRef, fieldRefList = [];
    viewRef = {
        'viewSid': $('#formViewSid').combobox('getValue'),
        'kind': 1,
        'objectSid': dataObj.attr.sid
    };
    $.each($('#fieldTable').children().children(), function() {
    	if ($(this).attr('sid')) {
    		fieldRefList.push({
                fieldStatus: $('select', $(this).children()).combobox('getValue'),
                fieldSid: $(this).attr('sid'),
                fieldEname: $(this).attr('ename'),
                tableName: $(this).attr('tableName')
            });
    	}
    });
    viewRef['viewRefDefList'] = fieldRefList;
	dataObj.viewReference = viewRef;
    $('#formFieldWin').window('close');
};

// 获取主键
function getId() {
    var id = Date.parse(new Date);
    return id;
};

// 校验流程
function validFlow(flow, nodeList, routeList, proxy, callback) {
    var breakNodeList = [];
    // 拼装保存数据
    var activityList = [], transitionList = [], eventList = [], actionList = [], partList = [], conditionList = [], viewReferenceList = [];
    
    // 活动相关数据
    $.each(nodeList, function() {
        var activity = this.attr;
        activity['processDefinitionSid'] = $('#processGrid').datagrid('getSelected').sid;
        activity['position'] = this.left + ':' + this.top
        if (this['activity-enter']) {
            $.each(this['activity-enter'].actionList, function() {
                actionList.push(this);
            });
            eventList.push(this['activity-enter']);
        }
        if (this['activity-leave']) {
            $.each(this['activity-leave'].actionList, function() {
                actionList.push(this);
            });
            eventList.push(this['activity-leave']);
        }
        if (this.partList) {
            $.each(this.partList, function() {
                this.activitySid = activity.sid;
                partList.push(this);
            });
        }
		if (this.viewReference) {
			viewReferenceList.push(this.viewReference);
		}
        activityList.push(activity);
    });
    
    // 路由相关数据
    $.each(routeList, function() {
        var transition = this.attr;
        transition['processDefinitionSid'] = $('#processGrid').datagrid('getSelected').sid;
        //transition['transition'] = this['transition'];
        if (this['transition']) {
            $.each(this['transition'].actionList, function() {
                actionList.push(this);
            });
            eventList.push(this['transition']);
        }
        if (this.conditionList) {
            $.each(this.conditionList, function() {
                conditionList.push(this);
            });
        }
        transitionList.push(transition);
    });
    
    if (flow['process-start']) {
        $.each(flow['process-start'].actionList, function() {
            actionList.push(this);
        });
        eventList.push(flow['process-start']);
    }
    
    if (flow['process-end']) {
        $.each(flow['process-end'].actionList, function() {
            actionList.push(this);
        });
        eventList.push(flow['process-end']);
    }
    
    flow.entity = {
        'entity.sid': $('#processGrid').datagrid('getSelected').sid,
        'entity.activityList': activityList,
        'entity.transitionList': transitionList,
        'entity.eventList': eventList,
        'entity.actionList': actionList,
        'entity.activityParticipationList': partList,
        'entity.variableDefinitionList': flow.variableDefinitionList,
        'entity.decisionConditionList': conditionList
    };
    $.post(CTX + '/bpm/ProcessDefinition!processValidation.action', flow.entity, function(data) {
        var flag = true;
        var msg = '校验通过';
        if (!data.success) {
            msg = data.msg;
            flag = false;
        }
        $.messager.show({
            msg: msg
        });
        if ($.isFunction(callback)) {
        	flow.entity = {
        	        'entity.sid': $('#processGrid').datagrid('getSelected').sid,
        	        'entity.activityList': activityList,
        	        'entity.transitionList': transitionList,
        	        'entity.eventList': eventList,
        	        'entity.actionList': actionList,
        	        'entity.activityParticipationList': partList,
        	        'entity.variableDefinitionList': flow.variableDefinitionList,
        	        'entity.decisionConditionList': conditionList,
        			'entity.viewReferenceList': viewReferenceList
        	    };
            callback(flag);
        }
    });
};

</script>
	<div id="easyui-title" style="display:none">
		            	流程绘制
	</div>
    <div id="table_names_hidden_div" style="display:none"></div>
        <div id="designer_workspace" class="wfmc_designer_workspace">
            <div id="wfmc_designer_toolsbar" class="wfmc_designer_toolsbar"></div>
            <div id="wfmc_designer_filesbar" class="wfmc_designer_filesbar"></div>
            <div id="wfmc_designer_list" class="wfmc_designer_panel"></div>
            <div id="designer_wfmc_statusbar" class="designer_wfmc_statusbar">
                <div id="designer_wfmc_statusbar_operation" class="designer_wfmc_statusbar_operation"></div>
                <div id="designer_wfmc_statusbar_cord" class="designer_wfmc_statusbar_cord"></div>
                <div id="statusbar_debug" class="designer_wfmc_statusbar_cord"></div>
            </div>
    </div>

